import { Tree as AntdTree, TreeProps } from 'antd';
import { Empty } from '../empty';

interface Props extends TreeProps {
  treeData: any[];
}

export const Tree = ({ treeData, ...props }: Props) => {
  if (!treeData || treeData.length === 0) {
    return (
      <div className="flex h-full w-full items-center justify-center">
        <Empty fontText="暂无数据" />
      </div>
    );
  }

  return <AntdTree treeData={treeData} {...props} />;
};
